package top.breezes.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.breezes.common.Response;
import top.breezes.model.User;
import top.breezes.service.UserService;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author yuchengxin
 * @Date 2020-05-28 10:46
 * @Description
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    /**
     * 根据id查询
     *
     * @param uid 用户id
     * @return
     */
    @GetMapping("/{id}")
    public Object findById(@PathVariable("id") Long uid) {
        return Response.success(userService.findById(uid));
    }

}
